home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_06_03
/
v6n3011a.txt
< prev
next >
Wrap
Text File
|
1989-09-26
|
679b
|
33 lines
char *strlower(string)
/* Transforms all characters in string to lower case */
char *string; /* String to transform */
{
char *pc;
/* Save the starting address */
pc = string;
while (*string)
{
if (isupper(*string))
*string = tolower(*string);
string++;
}
return pc;
}
Why not just:
while (*string)
{
*string = tolower(*string);
string++;
}
Personally I prefer:
for (; *string; string++)
*string = tolower(*string);